package com.spic.system.mapper;

import com.spic.system.domain.SysAnnounceReader;
import com.spic.system.domain.vo.SysAnnounceReaderVo;
import org.apache.ibatis.annotations.Param;

import java.util.List;
import java.util.Map;

/**
 * 阅读人Mapper接口
 *
 * @author spic
 * @date 2022-06-15
 */
public interface SysAnnounceReaderMapper
{
    /**
     * 查询阅读人
     *
     * @param id 阅读人主键
     * @return 阅读人
     */
    public SysAnnounceReader selectSysAnnounceReaderById(Long id);

    /**
     * 查询阅读人列表
     *
     * @param sysAnnounceReader 阅读人
     * @return 阅读人集合
     */
    public List<SysAnnounceReader> selectSysAnnounceReaderList(SysAnnounceReader sysAnnounceReader);

    /**
     * 新增阅读人
     *
     * @param sysAnnounceReader 阅读人
     * @return 结果
     */
    public int insertSysAnnounceReader(SysAnnounceReader sysAnnounceReader);

    /**
     * 修改阅读人
     *
     * @param sysAnnounceReader 阅读人
     * @return 结果
     */
    public int updateSysAnnounceReader(SysAnnounceReader sysAnnounceReader);

    /**
     * 删除阅读人
     *
     * @param id 阅读人主键
     * @return 结果
     */
    public int deleteSysAnnounceReaderById(Long id);

    /**
     * 批量删除阅读人
     *
     * @param ids 需要删除的数据主键集合
     * @return 结果
     */
    public int deleteSysAnnounceReaderByIds(Long[] ids);

    //app查询消息列表
    public List<SysAnnounceReaderVo> selectSysAnnounceReaderListByUserId(Long userId, String type,int dayNumber);

    public List<SysAnnounceReaderVo> selectAnnounceReaderByTypeList(Long userId, String type);
    //查询矿级的 数据
    public List<SysAnnounceReaderVo> selectAnnounceReaderByAnnounceIdList(String type);

    //根据 announceId 查询未读人列表
    public List<SysAnnounceReaderVo> selectSysAnnounceReaderListByAnnounceId(@Param("announceId") Long announceId,@Param("isRead") String isRead);

    public List<Map<String,String>> selectCountByType(Long userId);
}
